/*
 * Menu.hh
 *
 *  Created on: Nov 11, 2012
 *      Author: Zermingore
 */

#ifndef MENU_HH_
#   define MENU_HH_

#   include "common/stl.h"

class Menu
{
    public:
        Menu();
        virtual ~Menu();

    private:
        virtual void drawBackground();
        virtual void drawOptions();

        bool execOption(Option opt);

        // __________ display methods

        // shd add an animation to display menu (goldeneye watch style)
        /// draw the menu
        virtual void invoke();

        virtual void close();

        virtual void draw();

        /** switch to the next option
         ** pull clip (play anim)
         ** update tooltip
         ** called on mouse wheel down event
         */
        void nextOption();

        /** switch to the next option
         ** engage clip (play anim)
         ** update tooltip
         ** called on mouse wheel up event
         */
        void prevOption();

        /** play switch gun animation
         */
        void nextMenuSection();

        /// draw (animated ?) background
        void DrawBackground();

        /** calls DrawOption in loop
         */
        void DrawOptionList();

        /// navigate through option lists
        void switchOptionList();

        /** draw one (and only one option)
         ** \param index: number of previously displayed options
         **   => useful to calculate coords
         */
        void drawOption(Option opt, unsigned char index);

    private:
        int _type; /// which menu is it ?
        int _nbOpt; /// number of options in this menu
        bool _exitMenu; /// user quit menu request (cd be 2 start a game)

        // useless ? MMO
        // bool _pause; /// does this menu requests a pause

        Sound _sound; /// played sound while in menu

        Coords2D _mouseCoords;
        Coords2D _windowSize;
        std::map<std::map<Option>> _optList; /// Option list vector
};

#endif /* !MENU_HH_ */
